<?php
namespace app\wechat\model;
use app\wechat\model\BaseModel;
use think\Db;
use think\Request;
class Role extends BaseModel
{
	/**
     * 获取权限
     * @param
     * @return array
     */
    public function GetRole(){
      	$request = Request::instance();
      	$usercode = $request->post('usercode');
       	if ($usercode =='E00001') {
       		$menulist=Db::table('sys_menu')->fetchSql(false)->cache(false)->where($where)->select();
       	}else{
			$menulist=Db::query("SELECT * FROM sys_menu WHERE id IN(SELECT DISTINCT menuid FROM v_sys_user_right_menu_function WHERE usercode = '".$usercode."') OR id IN(SELECT DISTINCT menuid FROM v_sys_user_right_role_function WHERE usercode = '".$usercode."') AND STATUS='1' ");
       }
       return $menulist;
    }
}